package dongshi.daddy.stream;

import dongshi.daddy.stream.loadbalance.CanaryRuleConfiguration;
import org.slf4j.MDC;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
//@EnableJpaAuditing
//@ComponentScan(basePackages = {"com.geekbang"})
@EnableTransactionManagement
//用于扫描Dao @Repository
@EnableJpaRepositories(basePackages = {"dongshi.daddy"})
//用于扫描JPA实体类 @Entity，默认扫本包当下路径
@EntityScan(basePackages = {"dongshi.daddy"})
@LoadBalancerClient(value = "coupon-template-serv-stream", configuration = CanaryRuleConfiguration.class)
@EnableFeignClients(basePackages = { "dongshi.daddy" })
public class Stream_CustomerApplication {

    public static void main(String[] args) {
        MDC.put("traceId", "heyyyyy");
        MDC.put("spanId", "hiahiaaaa");

        SpringApplication.run(Stream_CustomerApplication.class, args);
    }
}
